<template>
  <div class="server_info">
    <table v-loading="loading">
      <tr>
        <td>操作系统</td>
        <td>{{ info.length>0 ? info[1].platform.slice(0,3) + 'dows' : ''}}</td>
      </tr>
      <tr>
        <td>硬件信息</td>
        <td>{{info.length>0 ?info[0].cpus : ''}}</td>
      </tr>
      <tr>
        <td>IP地址</td>
        <td>{{info.length>0 ?info[3].address : ''}}</td>
      </tr>
      <tr>
        <td>操作系统系列号</td>
        <td>{{info.length>0 ?info[2].release : ''}}</td>
      </tr>
      <tr>
        <td>cpu架构</td>
        <td>{{info.length>0 ?info[4].type : ''}}</td>
      </tr>
      <tr>
        <td>主机名</td>
        <td>{{info.length>0 ?info[5].name : ''}}</td>
      </tr>
    </table>
  </div>
</template>
<script setup>
import { serverInfo } from '@/api/os.js'
// import { ElLoading } from 'element-plus'
import { ref } from 'vue'
const info = ref([])
const loading = ref(true)
async function getInfo () {
  // ElLoading.service({})
  const { data } = await serverInfo()
  loading.value = false
  info.value = data
}
getInfo()
</script>
<style lang="less" scoped>
.server_info {
  flex: 1;
  table{
    width: 100%;
    height: 100%;
    tr{
      background: #b4aeae;
    }
  }
}
</style>
